﻿@model BasiliskBugTracker.WebClient.Areas.Administration.Models.ProjectViewModel

@{
    ViewBag.Title = "Create";
}

<h2>Create</h2>


@using (Html.BeginForm())
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary(true)

    <fieldset class="form-horizontal">
        <legend>Project</legend>

        <div class="control-group">
            @Html.LabelFor(model => model.Name, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Name)
                @Html.ValidationMessageFor(model => model.Name, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="control-group">
            @Html.LabelFor(model => model.Description, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Description)
                @Html.ValidationMessageFor(model => model.Description, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="control-group">
            @Html.LabelFor(model => model.Manager, new { @class = "control-label" })
            <div class="controls">
                @(Html.Kendo().DropDownList()
                .Name("Manager") // Name of the widget should be the same as the name of the property
                .DataValueField("Id")
                .DataTextField("Name")
                .DataSource(source =>
                {
                    source.Read(read =>
                    {
                        read.Action("GetProjectManagers", "Projects");
                    });
                })
                )
            </div>
        </div>

        <div class="control-group">
            @Html.LabelFor(model => model.Contributors, new { @class = "control-label" })
            <div class="controls">
                @Html.EditorFor(model => model.Contributors)
                @Html.ValidationMessageFor(model => model.Contributors, null, new { @class = "help-inline" })
            </div>
        </div>

        <div class="form-actions no-color">
            <input type="submit" value="Create" class="btn" />
        </div>
    </fieldset>
}

<div>
    <a href="/Administration/Projects" class="btn btn-primary">Back to all projects</a>
</div>

@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}

